#pragma once

#include <string>
#include <vector>
#include <Eigen/Geometry>

enum EulerOrder
{
	// ORDER & COMP0 = part0
	// ORDER & COMP1 = part1
	// ORDER & COMP2 = part2
	XYZ = 0x000102,
	XZY = 0x000201,
	YXZ = 0x010002,
	YZX = 0x010200,
	ZXY = 0x020001,
	ZYX = 0x020100
};
enum EulerOrderCompMask
{
	COMP0 = 0x00FF0000,
	COMP1 = 0x0000FF00,
	COMP2 = 0x000000FF 
};
enum EulerOrderCompShift
{
	SHIFT0 = 16,
	SHIFT1 = 8,
	SHIFT2 = 0
};

struct stTransform {
	Eigen::Vector3f t;
	Eigen::Quaternionf q;
};


typedef std::vector<std::string> string_vector;
string_vector split_string (const std::string& str, const char ch);

Eigen::Quaternionf
euler2Quat (
	const float x,
	const float y,
	const float z,
	EulerOrder order
	);

/*
If order is YXZ, then ang0~ang2 equals to Y~Z.
If order is XYZ, then ang0~ang2 equals to X~Z.
etc...
*/
Eigen::Quaternionf
sortedEuler2Quat (
	const float ang0,
	const float ang1,
	const float ang2,
	EulerOrder order
	);

// angle to radian
float a2r(float angle);